package huixue.cn.com.rxapp.app;

import android.content.Context;
import android.support.multidex.MultiDex;

import com.facebook.stetho.Stetho;
import com.github.anrwatchdog.ANRWatchDog;
import com.squareup.leakcanary.LeakCanary;
import com.alibaba.android.arouter.launcher.ARouter;

import huixue.cn.com.library.app.BaseApplication;
import huixue.cn.com.library.util.LogUtils;
import huixue.cn.com.library.util.SdUtils;
import huixue.cn.com.rxapp.config.SystemConfig;
import huixue.cn.com.rxapp.rx.ProxyActivity;
import huixue.cn.com.rxapp.util.HookStartActivityUtil;

/**
 * Created by gongdongyang on 2018/7/17.
 */

public class RxAppApplication extends BaseApplication {

    @Override
    public void onCreate() {

        super.onCreate();

        LeakCanary.install(this);
        SystemConfig.getSystemConfig().initConfig();

        new ANRWatchDog().start();

        ARouter.openLog();     // 打印日志
        ARouter.openDebug();   // 开启调试模式(如果在InstantRun模式下运行，必须开启调试模式！线上版本需要关闭,否则有安全风险)
        ARouter.init( this );
        Stetho.initializeWithDefaults(this);

        /*HookStartActivityUtil hookStartActivityUtil = new HookStartActivityUtil(this , ProxyActivity.class) ;
        try {
            hookStartActivityUtil.hookStartActivity();
            hookStartActivityUtil.hookLaunchActivity();
        } catch (Exception e) {
            e.printStackTrace();
        }*/
    }

    @Override
    protected void attachBaseContext(Context base) {
        super.attachBaseContext(base);
        MultiDex.install(this);
    }


}
